/*************************************************
 * 
 * Copyright by Bruno Eberhard
 * 
 * Created on 29.07.2005
 *
 *************************************************/
package fightplan.ui;

import java.awt.CardLayout;
import java.awt.Component;

import javax.swing.JPanel;

@SuppressWarnings("serial")
public class CardPanel extends JPanel {
	private int counter;

	public CardPanel() {
		super(new CardLayout());
	}

	public void addCard(Component component) {
		String name = "" + (counter++);
		component.setName(name);
		add(component, name);
	}

	public void showCard(Component component) {
		((CardLayout) getLayout()).show(this, component.getName());
	}

}
